<?php
/**
 * Dao of Customer
 *
 * @author fsqijy
 */
require_once BaseUtil::getModulePath("base") . '/models/BaseDao.php';
class AgentCertificatesDao extends BaseDao{
    protected $_name;
    public function  _setup() {
        $this->_name = $this->prefix() . "agent_certificates";
        parent::_setup();
    }
    public function getByUserID($userID){
        $select = $this->db_r->select();
        $select->from($this->_name);
        $select->where("is_delete = 0");
        $select->where("user_id = ? ",$userID);
        $sql = $select->__toString();
        return $this->db_r->fetchRow($sql);
    }
    public function updateByUserID($set,$id) {
        $where = $this->db_w->quoteInto('user_id = ?', $id);
        $this->updateData($set,$where);
    }
}